package com.dyb.recuitment.controller;


import com.dyb.recuitment.entity.Area;
import com.dyb.recuitment.service.IAreaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 区域表（国省市区） 前端控制器
 * </p>
 *
 * @author 邓宇斌
 * @since 2022-02-22
 */
@RestController
@Api(tags = "区域表(Area)")
@RequestMapping("/area")
public class AreaController {

    @Autowired
    private IAreaService areaService;

    @ApiOperation(value = "按条件获取区域信息", notes = "按条件获取区域信息 {\"name\":\"\"}")
    @ApiImplicitParam(name = "area", value = "Area类")
    @PostMapping("/selectByArea")
    public Object selectByArea(@RequestBody Area area) {
        return areaService.selectByArea(area);
    }

    @ApiOperation(value = "查询城市", notes = "查询城市")
    @GetMapping("/selectCity")
    public Object selectCity() {
        return areaService.selectCity();
    }

    @ApiOperation(value = "获取所有区域信息", notes = "获取所有区域信息")
    @GetMapping("/selectAllArea")
    public Object selectAllArea() {
        return areaService.selectAllArea();
    }

}
